<template>
  <a-table
      :columns="columns"
      :data-source="data"
      :pagination="{ pageSize:20 }"

 >
    <template #bodyCell="{ column, text }">
      <template v-if="column.dataIndex === 'imageUrl'">
        <a-image
            :width="64"
            :src="text"
        />
      </template>
      <template v-if="column.dataIndex === 'livingBody'">
        <a-tag v-if="text=='正常'" color="success">{{ text }}</a-tag>
        <a-tag v-else  color="warning">{{ text }}</a-tag>
      </template>
    </template>
  </a-table>
</template>
<script lang="ts" setup>
import {onMounted, ref} from "vue";
import _axios, {dataUrl} from "@/http/request";

onMounted(() => {
  _axios.post(dataUrl + "/fact-info-log/get", {}).then((res) => {
    console.log(res.data)
    data.value=res.data.data.records
  })
})

const columns = [
  {
    title: '员工Id',
    dataIndex: 'userId',
    width: 150,
  },
  {
    title: '姓名',
    dataIndex: 'name'
  },
  {
    title: '性别',
    dataIndex: 'sex'
  },
  {
    title: '年龄',
    dataIndex: 'age'
  },
  {
    title: '图片地址',
    dataIndex: 'imageUrl',
    width: 150,
  },
  {
    title: '真伪',
    dataIndex: 'livingBody'
  },
  {
    title: '3D脸部信息',
    dataIndex: 'face3D',
  },
  {
    title: '打卡时间',
    dataIndex: 'createTime',
  },
];

const data =ref([]);
</script>

